1. Field of the Invention
The invention relates to an image processing apparatus and method and, more particularly, to an encoding technique for encoding image data.
2. Related Background Art
For example, in an interframe or interfield encoding (it is assumed that xe2x80x9cinterframe encodingxe2x80x9d is used here) using a motion compensation represented by MPEG, a detection (search) of a motion vector is performed to forward and backward frames around a target frame to be subjected to an encoding on a unit basis (xe2x80x9cmacroblock unitxe2x80x9d here) of a macroblock or a block of (8xc3x978) pixels.
In this instance, a search for motion vectors is uniformly made to all macroblocks existing in the target frame irrespective of an amount of motion between frames regarding image data in the actual macroblock, or a search range for the motion vectors is limited to a predetermined range around a target macroblock to be subjected to an encoding, due to a requirement for the real-time operations of encoding and decoding, and the motion vectors are searched in such a range. The search range for the motion vector in this instance is also often determined from the limitation of a processing time caused by hardware and a processing time caused by software, irrespective of an actual motion amount of image data of each macroblock.
However, hitherto, in case of performing a motion compensation by searching for a motion vector in a certain limited predetermined range, since the search range is determined irrespective of the actual motion amount of the image data of each macroblock as mentioned above, there is a possibility that the object that a code amount is reduced by decreasing redundancy of image data between frames, which is an advantage of the interframe encoding using the motion compensation, is not accomplished, for example, if the actual motion vector exceeds the search range.
In the work such that the image data which was orthogonal-transformed (for example, 2-dimensional discrete cosine transform: DCT, or the like) is divided by a quantization coefficient weighted by a frequency, which work is one of the processing steps in the image data compressing method which is executed in the MPEG or the like, the quantization coefficient is also determined on the basis of the final generation code amount irrespective of the motion amount of the image data in the target macroblock to be subjected to the encoding. Therefore, the quantization coefficient cannot be corrected in accordance with the motion amount, so that there is a danger of causing the deterioration of the picture quality.
In consideration of circumstances as mentioned above, it is an object of the invention to provide an encoding apparatus and method which can efficiently encode image data and improve a picture quality.
To accomplish the above object, according to a preferred aspect of the invention, there is provided an encoding apparatus/method of encoding input image data by using a motion compensation on a unit basis of block of a predetermined size, comprising the steps of: searching for a motion vector with respect to a block located at a first predetermined position among blocks constructing one picture; forming a first motion vector representing a motion of image data of one picture from the searched motion vector of each block; and performing the motion compensation on the input image data in accordance with the formed first motion vector to encode the image data.
Other objects, features and advantages of the invention will become apparent from the following detailed description taken in conjunction with the accompanying drawings.